Skip to content

feat: rework decision-card to make it based on AST parsing#41

Merged
PatrickSys merged 3 commits intomasterfrom
edit-decision-card-and-ranked-search
Feb 21, 2026
Merged

feat: rework decision-card to make it based on AST parsing#41
PatrickSys merged 3 commits intomasterfrom
edit-decision-card-and-ranked-search

Conversation

@PatrickSys
Copy link
Owner

Summary

  • When searching with intent="edit", results now include a decision card (preflight) telling you whether there's enough evidence to proceed. ready: true means proceed. ready: false comes with nextAction (what to look up first) and whatWouldHelp (specific searches to close the gap).
  • Exact-name queries now rank the file that defines a symbol above files that only import it, so the class or function definition shows up first instead of a caller.
  • includeSnippets: true now prepends a scope comment (// ClassName.methodName) to each snippet so agents can orient without an extra file read.
  • Fixes a null-pointer crash in GenericAnalyzer when chunk content is undefined.

Test plan

  • npm test passes (234 tests, 0 failures)
  • Search with intent="edit" returns preflight.ready as boolean
  • Search with includeSnippets: true returns snippet starting with //
  • CHANGELOG has exactly one ## [Unreleased] block
  • Tests verify decision card output shape and scope-prefixed snippets

Generated with Claude Code (claude.com/claude-code)

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@greptile-apps
Copy link

greptile-apps bot commented Feb 21, 2026

Greptile Summary

This PR adds comprehensive test coverage for the edit decision card and scope-prefixed snippets features that were implemented in PR #40. It also fixes a null-pointer crash in GenericAnalyzer and cleans up the CHANGELOG by consolidating release notes and removing the duplicate ## [Unreleased] header.

The changes are documentation and test-focused:

  • Tests added: Two new test suites verify decision card output shape (preflight.ready as boolean) and snippet scope headers (comments starting with //)
  • Bug fix: Added null guard in summarize() method to prevent crashes when chunk.content is undefined
  • Documentation: CHANGELOG reorganized for clarity, removing internal implementation details and focusing on user-facing changes
  • Stability: No breaking changes; purely additive tests and defensive null checks

All test plan items are verifiable and accurate.

Confidence Score: 5/5

  • Safe to merge - defensive bug fix plus test coverage with no breaking changes
  • Bug fix is correct (null guard before string operations), tests are well-structured and verify actual behavior, CHANGELOG cleanup improves clarity, no risky changes
  • No files require special attention

Important Files Changed

Filename Overview
src/analyzers/generic/index.ts Fixed null-pointer crash by adding content guard in summarize() and typed extractFirstComment() parameter
tests/search-decision-card.test.ts Added comprehensive tests for edit intent decision card output shape and fields
tests/search-snippets.test.ts Added tests verifying snippets with scope headers when includeSnippets: true

Last reviewed commit: 397d509

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@PatrickSys PatrickSys changed the title feat: edit decision card and definition-first result ranking feat: rework decision-card to make it based on AST parsing Feb 21, 2026
@PatrickSys PatrickSys merged commit ac4389d into master Feb 21, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant